package com.zjy.springbootinit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    Environment env;

    @RequestMapping("/hello")
    public String hello(){
        System.out.println("王五,我的第一个SpringBoot项目");
        return "我是王五，我的第一个SpringBoot项目！当前端口是："+ env.getProperty("server,port");
    }
}
